package com.qfmy.model.enums;

/**
 * @author 清风明月
 * @Package com.qfmy.model.enums
 * @date 2025/11//11
 * @description 用户优惠卷的状态
 */
public enum UserCouponStatus {
    NOT_USED(0, "未使用"),
    USED(1, "已使用"),
    EXPIRED(2, "已过期");

    private Integer status;
    private String message;

    UserCouponStatus(Integer status, String message) {
        this.status = status;
        this.message = message;
    }

    public Integer getStatus() {
        return status;
    }

    public String getMessage() {
        return message;
    }

    /**
     * 通过状态码获取枚举
     * @param status
     * @return
     */
    public static String getMessageByStatus(Integer status) {
        for (UserCouponStatus value : UserCouponStatus.values()) {
            if (value.status.equals(status)) {
                return value.message;
            }
        }
        return null;
    }

}
